//
//  DDCompanySuperinerView.m
//  DingDongZP
//
//  Created by weily on 16/5/9.
//  Copyright © 2016年 iyhjiang.com. All rights reserved.
//

#import "DDCompanySuperinerView.h"
#import "CCUICreator.h"

@interface DDCompanySuperinerView ()



@end

@implementation DDCompanySuperinerView

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        
        self.backgroundColor = [UIColor whiteColor];
        self.layer.masksToBounds = YES;
        self.layer.cornerRadius = 4.0;
        
        UIImageView *avatar = [[UIImageView alloc] initWithFrame:CGRectZero];
        avatar.image = [UIImage imageNamed:@"common_avatar"];
        [self addSubview:avatar];
        [avatar mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(50, 50));
            make.centerX.equalTo(self);
            make.top.equalTo(self).offset(5);
        }];
        self.avatarView = avatar;
        self.avatarView.layer.cornerRadius = 25;
        self.avatarView.layer.masksToBounds = YES;
        
        UILabel *nameLab = [UILabel labelWithFrame:CGRectZero font:[UIFont systemFontOfSize:14.0] textColor:[UIColor blackColor] text:@"高管"];
        [self addSubview:nameLab];
        [nameLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(avatar);
            make.top.equalTo(avatar.mas_bottom).offset(5);
        }];
        self.nameLab = nameLab;
        
        UILabel *position = [UILabel labelWithFrame:CGRectZero font:[UIFont systemFontOfSize:14.0] textColor:COLOR_FONT_DARK_GRAY text:@"CEO"];
        [self addSubview:position];
        [position mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(nameLab);
            make.top.equalTo(nameLab.mas_bottom).offset(5);
        }];
        self.positionLab = position;
        
        
    }
    return self;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
